3.1.96 \(\int \frac {(a+b x)^2 (A+B x)}{x} \, dx\) [96]

Optimal. Leaf size=40 \[ 2 a A b x+\frac {1}{2} A b^2 x^2+\frac {B (a+b x)^3}{3 b}+a^2 A \log (x) \]

[Out]

2*a*A*b*x+1/2*A*b^2*x^2+1/3*B*(b*x+a)^3/b+a^2*A*ln(x)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {81, 45} \begin {gather*} a^2 A \log (x)+2 a A b x+\frac {B (a+b x)^3}{3 b}+\frac {1}{2} A b^2 x^2 \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((a + b*x)^2*(A + B*x))/x,x]

[Out]

2*a*A*b*x + (A*b^2*x^2)/2 + (B*(a + b*x)^3)/(3*b) + a^2*A*Log[x]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 81

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(c + d*x)^
(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] + Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(
d*f*(n + p + 2)), Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2,
0]

Rubi steps

\begin {align*} \int \frac {(a+b x)^2 (A+B x)}{x} \, dx &=\frac {B (a+b x)^3}{3 b}+A \int \frac {(a+b x)^2}{x} \, dx\\ &=\frac {B (a+b x)^3}{3 b}+A \int \left (2 a b+\frac {a^2}{x}+b^2 x\right ) \, dx\\ &=2 a A b x+\frac {1}{2} A b^2 x^2+\frac {B (a+b x)^3}{3 b}+a^2 A \log (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 43, normalized size = 1.08 \begin {gather*} a^2 B x+a b x (2 A+B x)+\frac {1}{6} b^2 x^2 (3 A+2 B x)+a^2 A \log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((a + b*x)^2*(A + B*x))/x,x]

[Out]

a^2*B*x + a*b*x*(2*A + B*x) + (b^2*x^2*(3*A + 2*B*x))/6 + a^2*A*Log[x]

________________________________________________________________________________________

Maple [A]
time = 0.06, size = 46, normalized size = 1.15

method result size
default \(\frac {b^{2} B \,x^{3}}{3}+\frac {A \,b^{2} x^{2}}{2}+B a b \,x^{2}+2 a A b x +a^{2} B x +a^{2} A \ln \left (x \right )\) \(46\)
norman \(\left (\frac {1}{2} b^{2} A +a b B \right ) x^{2}+\left (2 a b A +a^{2} B \right ) x +\frac {b^{2} B \,x^{3}}{3}+a^{2} A \ln \left (x \right )\) \(46\)
risch \(\frac {b^{2} B \,x^{3}}{3}+\frac {A \,b^{2} x^{2}}{2}+B a b \,x^{2}+2 a A b x +a^{2} B x +a^{2} A \ln \left (x \right )\) \(46\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x+a)^2*(B*x+A)/x,x,method=_RETURNVERBOSE)

[Out]

1/3*b^2*B*x^3+1/2*A*b^2*x^2+B*a*b*x^2+2*a*A*b*x+a^2*B*x+a^2*A*ln(x)

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 46, normalized size = 1.15 \begin {gather*} \frac {1}{3} \, B b^{2} x^{3} + A a^{2} \log \left (x\right ) + \frac {1}{2} \, {\left (2 \, B a b + A b^{2}\right )} x^{2} + {\left (B a^{2} + 2 \, A a b\right )} x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*(B*x+A)/x,x, algorithm="maxima")

[Out]

1/3*B*b^2*x^3 + A*a^2*log(x) + 1/2*(2*B*a*b + A*b^2)*x^2 + (B*a^2 + 2*A*a*b)*x

________________________________________________________________________________________

Fricas [A]
time = 0.85, size = 46, normalized size = 1.15 \begin {gather*} \frac {1}{3} \, B b^{2} x^{3} + A a^{2} \log \left (x\right ) + \frac {1}{2} \, {\left (2 \, B a b + A b^{2}\right )} x^{2} + {\left (B a^{2} + 2 \, A a b\right )} x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*(B*x+A)/x,x, algorithm="fricas")

[Out]

1/3*B*b^2*x^3 + A*a^2*log(x) + 1/2*(2*B*a*b + A*b^2)*x^2 + (B*a^2 + 2*A*a*b)*x

________________________________________________________________________________________

Sympy [A]
time = 0.05, size = 46, normalized size = 1.15 \begin {gather*} A a^{2} \log {\left (x \right )} + \frac {B b^{2} x^{3}}{3} + x^{2} \left (\frac {A b^{2}}{2} + B a b\right ) + x \left (2 A a b + B a^{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)**2*(B*x+A)/x,x)

[Out]

A*a**2*log(x) + B*b**2*x**3/3 + x**2*(A*b**2/2 + B*a*b) + x*(2*A*a*b + B*a**2)

________________________________________________________________________________________

Giac [A]
time = 2.15, size = 46, normalized size = 1.15 \begin {gather*} \frac {1}{3} \, B b^{2} x^{3} + B a b x^{2} + \frac {1}{2} \, A b^{2} x^{2} + B a^{2} x + 2 \, A a b x + A a^{2} \log \left ({\left | x \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x+a)^2*(B*x+A)/x,x, algorithm="giac")

[Out]

1/3*B*b^2*x^3 + B*a*b*x^2 + 1/2*A*b^2*x^2 + B*a^2*x + 2*A*a*b*x + A*a^2*log(abs(x))

________________________________________________________________________________________

Mupad [B]
time = 0.04, size = 45, normalized size = 1.12 \begin {gather*} x^2\,\left (\frac {A\,b^2}{2}+B\,a\,b\right )+x\,\left (B\,a^2+2\,A\,b\,a\right )+\frac {B\,b^2\,x^3}{3}+A\,a^2\,\ln \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(a + b*x)^2)/x,x)

[Out]

x^2*((A*b^2)/2 + B*a*b) + x*(B*a^2 + 2*A*a*b) + (B*b^2*x^3)/3 + A*a^2*log(x)

________________________________________________________________________________________